var express = require('express');
var router = express.Router();

// 引入自己封装的连接
var user = require('../modules/handel')

/* GET home page. */
router.get('/', function (req, res, next) {
  res.render('index', { title: 'Express' });
});

//查询所有数据
router.get('/queryAll', function (req, res, next) {
  user.queryAll(req, res, next)
})
//按照条件查询
router.get('/queryBySome', function (req, res, next) {
  user.queryBySome(req, res, next)
})
//添加一条数据
router.get('/addSome', function (req, res, next) {
  user.addSome(req, res, next)
})
//删除一条数据
router.get('/deleteSome', function (req, res, next) {
  user.deleteSome(req, res, next)
})
//编辑一条数据
router.get('/updateSome', function (req, res, next) {
  user.updateSome(req, res, next)
})
module.exports = router;
